﻿
using Fozzy.Being;

using System.Collections.Generic;

namespace Fozzy.Family
{
    /// <summary>
    /// One family group. 
    /// </summary>  
    public class Children                                       : Enumeration<Person>
    {
        #region States
        #endregion

        #region Properties
            //public override IEnumerable<Person>     Instances   { get { return Static.Map.Children(Value)                       ; } }
        #endregion

        #region Constructeur
            /// <summary>
            /// En Création
            /// Avec une particularité : Les Child sont des enregistrements physiques en Gedcom
            /// ce qui oblige à les caster en Person
            /// </summary>
            /// <param name="source"></param>
            public Children(_Element source)                     : base(source.Elements("Child"))
            {}
            /// <summary>
            /// En Interrogation
            /// </summary>
            /// <param name="source"></param>
            public Children(Person person)                      : base(person)
            {}
        #endregion


            

            ////Inutile : Prévu par Objects
            //public override void Export()
            //{
            //    base.Export()                                   ;
            //    foreach (Child child in Instances) child.Export();
            //}

        //    // Children.
        //    foreach (Person child in family.Children)
        //    {
        //        WriteLine(1, "CHIL", string.Format(CultureInfo.InvariantCulture, "@{0}@", idMap.Get(child.Id)));
        //    }


            //string[] children;
            //XmlNodeList list = node.SelectNodes("CHIL");
            //children = new string[list.Count];
            //for (int i = 0; i < list.Count; i++) children[i] = GetId(list[i]);
            //return children;
    }
}
